3.53 \(\int \sec (c+d x) (a+i a \tan (c+d x))^4 \, dx\)

Optimal. Leaf size=133 \[ \frac {35 i a^4 \sec (c+d x)}{8 d}+\frac {35 a^4 \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {35 i \sec (c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{24 d}+\frac {7 i \sec (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{12 d}+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d} \]

[Out]

35/8*a^4*arctanh(sin(d*x+c))/d+35/8*I*a^4*sec(d*x+c)/d+1/4*I*a*sec(d*x+c)*(a+I*a*tan(d*x+c))^3/d+7/12*I*sec(d*
x+c)*(a^2+I*a^2*tan(d*x+c))^2/d+35/24*I*sec(d*x+c)*(a^4+I*a^4*tan(d*x+c))/d

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 133, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {3498, 3486, 3770} \[ \frac {35 i a^4 \sec (c+d x)}{8 d}+\frac {35 a^4 \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {7 i \sec (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{12 d}+\frac {35 i \sec (c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{24 d}+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]*(a + I*a*Tan[c + d*x])^4,x]

[Out]

(35*a^4*ArcTanh[Sin[c + d*x]])/(8*d) + (((35*I)/8)*a^4*Sec[c + d*x])/d + ((I/4)*a*Sec[c + d*x]*(a + I*a*Tan[c
+ d*x])^3)/d + (((7*I)/12)*Sec[c + d*x]*(a^2 + I*a^2*Tan[c + d*x])^2)/d + (((35*I)/24)*Sec[c + d*x]*(a^4 + I*a
^4*Tan[c + d*x]))/d

Rule 3486

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*(d*Sec[
e + f*x])^m)/(f*m), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rule 3498

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(d
*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^(n - 1))/(f*(m + n - 1)), x] + Dist[(a*(m + 2*n - 2))/(m + n - 1), Int[(
d*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^(n - 1), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && EqQ[a^2 + b^2, 0] &&
 GtQ[n, 0] && NeQ[m + n - 1, 0] && IntegersQ[2*m, 2*n]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \sec (c+d x) (a+i a \tan (c+d x))^4 \, dx &=\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d}+\frac {1}{4} (7 a) \int \sec (c+d x) (a+i a \tan (c+d x))^3 \, dx\\ &=\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d}+\frac {7 i \sec (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{12 d}+\frac {1}{12} \left (35 a^2\right ) \int \sec (c+d x) (a+i a \tan (c+d x))^2 \, dx\\ &=\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d}+\frac {7 i \sec (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{12 d}+\frac {35 i \sec (c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{24 d}+\frac {1}{8} \left (35 a^3\right ) \int \sec (c+d x) (a+i a \tan (c+d x)) \, dx\\ &=\frac {35 i a^4 \sec (c+d x)}{8 d}+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d}+\frac {7 i \sec (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{12 d}+\frac {35 i \sec (c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{24 d}+\frac {1}{8} \left (35 a^4\right ) \int \sec (c+d x) \, dx\\ &=\frac {35 a^4 \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {35 i a^4 \sec (c+d x)}{8 d}+\frac {i a \sec (c+d x) (a+i a \tan (c+d x))^3}{4 d}+\frac {7 i \sec (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{12 d}+\frac {35 i \sec (c+d x) \left (a^4+i a^4 \tan (c+d x)\right )}{24 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 1.48, size = 237, normalized size = 1.78 \[ -\frac {a^4 \sec ^4(c+d x) \left (3 \left (42 \sin (c+d x)+58 \sin (3 (c+d x))-128 i \cos (3 (c+d x))+35 \cos (4 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+105 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+140 \cos (2 (c+d x)) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )\right )-35 \cos (4 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )-105 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )\right )-896 i \cos (c+d x)\right )}{192 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]*(a + I*a*Tan[c + d*x])^4,x]

[Out]

-1/192*(a^4*Sec[c + d*x]^4*((-896*I)*Cos[c + d*x] + 3*((-128*I)*Cos[3*(c + d*x)] + 105*Log[Cos[(c + d*x)/2] -
Sin[(c + d*x)/2]] + 35*Cos[4*(c + d*x)]*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 140*Cos[2*(c + d*x)]*(Log[C
os[(c + d*x)/2] - Sin[(c + d*x)/2]] - Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]) - 105*Log[Cos[(c + d*x)/2] + S
in[(c + d*x)/2]] - 35*Cos[4*(c + d*x)]*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + 42*Sin[c + d*x] + 58*Sin[3*(
c + d*x)])))/d

________________________________________________________________________________________

fricas [B]  time = 0.57, size = 256, normalized size = 1.92 \[ \frac {558 i \, a^{4} e^{\left (7 i \, d x + 7 i \, c\right )} + 1022 i \, a^{4} e^{\left (5 i \, d x + 5 i \, c\right )} + 770 i \, a^{4} e^{\left (3 i \, d x + 3 i \, c\right )} + 210 i \, a^{4} e^{\left (i \, d x + i \, c\right )} + 105 \, {\left (a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{4}\right )} \log \left (e^{\left (i \, d x + i \, c\right )} + i\right ) - 105 \, {\left (a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{4}\right )} \log \left (e^{\left (i \, d x + i \, c\right )} - i\right )}{24 \, {\left (d e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+I*a*tan(d*x+c))^4,x, algorithm="fricas")

[Out]

1/24*(558*I*a^4*e^(7*I*d*x + 7*I*c) + 1022*I*a^4*e^(5*I*d*x + 5*I*c) + 770*I*a^4*e^(3*I*d*x + 3*I*c) + 210*I*a
^4*e^(I*d*x + I*c) + 105*(a^4*e^(8*I*d*x + 8*I*c) + 4*a^4*e^(6*I*d*x + 6*I*c) + 6*a^4*e^(4*I*d*x + 4*I*c) + 4*
a^4*e^(2*I*d*x + 2*I*c) + a^4)*log(e^(I*d*x + I*c) + I) - 105*(a^4*e^(8*I*d*x + 8*I*c) + 4*a^4*e^(6*I*d*x + 6*
I*c) + 6*a^4*e^(4*I*d*x + 4*I*c) + 4*a^4*e^(2*I*d*x + 2*I*c) + a^4)*log(e^(I*d*x + I*c) - I))/(d*e^(8*I*d*x +
8*I*c) + 4*d*e^(6*I*d*x + 6*I*c) + 6*d*e^(4*I*d*x + 4*I*c) + 4*d*e^(2*I*d*x + 2*I*c) + d)

________________________________________________________________________________________

giac [A]  time = 1.62, size = 173, normalized size = 1.30 \[ \frac {105 \, a^{4} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right ) - 105 \, a^{4} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right ) - \frac {2 \, {\left (81 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 96 i \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 105 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 480 i \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 105 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 544 i \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 81 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 160 i \, a^{4}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+I*a*tan(d*x+c))^4,x, algorithm="giac")

[Out]

1/24*(105*a^4*log(tan(1/2*d*x + 1/2*c) + 1) - 105*a^4*log(tan(1/2*d*x + 1/2*c) - 1) - 2*(81*a^4*tan(1/2*d*x +
1/2*c)^7 + 96*I*a^4*tan(1/2*d*x + 1/2*c)^6 - 105*a^4*tan(1/2*d*x + 1/2*c)^5 - 480*I*a^4*tan(1/2*d*x + 1/2*c)^4
 - 105*a^4*tan(1/2*d*x + 1/2*c)^3 + 544*I*a^4*tan(1/2*d*x + 1/2*c)^2 + 81*a^4*tan(1/2*d*x + 1/2*c) - 160*I*a^4
)/(tan(1/2*d*x + 1/2*c)^2 - 1)^4)/d

________________________________________________________________________________________

maple [A]  time = 0.27, size = 231, normalized size = 1.74 \[ \frac {a^{4} \left (\sin ^{5}\left (d x +c \right )\right )}{4 d \cos \left (d x +c \right )^{4}}-\frac {a^{4} \left (\sin ^{5}\left (d x +c \right )\right )}{8 d \cos \left (d x +c \right )^{2}}-\frac {a^{4} \left (\sin ^{3}\left (d x +c \right )\right )}{8 d}-\frac {27 a^{4} \sin \left (d x +c \right )}{8 d}+\frac {35 a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8 d}-\frac {4 i a^{4} \left (\sin ^{4}\left (d x +c \right )\right )}{3 d \cos \left (d x +c \right )^{3}}+\frac {4 i a^{4} \left (\sin ^{4}\left (d x +c \right )\right )}{3 d \cos \left (d x +c \right )}+\frac {4 i a^{4} \cos \left (d x +c \right ) \left (\sin ^{2}\left (d x +c \right )\right )}{3 d}+\frac {8 i a^{4} \cos \left (d x +c \right )}{3 d}-\frac {3 a^{4} \left (\sin ^{3}\left (d x +c \right )\right )}{d \cos \left (d x +c \right )^{2}}+\frac {4 i a^{4}}{d \cos \left (d x +c \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)*(a+I*a*tan(d*x+c))^4,x)

[Out]

1/4/d*a^4*sin(d*x+c)^5/cos(d*x+c)^4-1/8/d*a^4*sin(d*x+c)^5/cos(d*x+c)^2-1/8*a^4*sin(d*x+c)^3/d-27/8*a^4*sin(d*
x+c)/d+35/8/d*a^4*ln(sec(d*x+c)+tan(d*x+c))-4/3*I/d*a^4*sin(d*x+c)^4/cos(d*x+c)^3+4/3*I/d*a^4*sin(d*x+c)^4/cos
(d*x+c)+4/3*I/d*a^4*cos(d*x+c)*sin(d*x+c)^2+8/3*I/d*a^4*cos(d*x+c)-3/d*a^4*sin(d*x+c)^3/cos(d*x+c)^2+4*I/d*a^4
/cos(d*x+c)

________________________________________________________________________________________

maxima [A]  time = 0.47, size = 180, normalized size = 1.35 \[ \frac {3 \, a^{4} {\left (\frac {2 \, {\left (5 \, \sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} + 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 72 \, a^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} + \log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, a^{4} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + \frac {192 i \, a^{4}}{\cos \left (d x + c\right )} + \frac {64 i \, {\left (3 \, \cos \left (d x + c\right )^{2} - 1\right )} a^{4}}{\cos \left (d x + c\right )^{3}}}{48 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+I*a*tan(d*x+c))^4,x, algorithm="maxima")

[Out]

1/48*(3*a^4*(2*(5*sin(d*x + c)^3 - 3*sin(d*x + c))/(sin(d*x + c)^4 - 2*sin(d*x + c)^2 + 1) + 3*log(sin(d*x + c
) + 1) - 3*log(sin(d*x + c) - 1)) + 72*a^4*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) + log(sin(d*x + c) + 1) - log(
sin(d*x + c) - 1)) + 48*a^4*log(sec(d*x + c) + tan(d*x + c)) + 192*I*a^4/cos(d*x + c) + 64*I*(3*cos(d*x + c)^2
 - 1)*a^4/cos(d*x + c)^3)/d

________________________________________________________________________________________

mupad [B]  time = 6.77, size = 198, normalized size = 1.49 \[ \frac {35\,a^4\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{4\,d}-\frac {\frac {27\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{4}+a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,8{}\mathrm {i}-\frac {35\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{4}-a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,40{}\mathrm {i}-\frac {35\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{4}+\frac {a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,136{}\mathrm {i}}{3}+\frac {27\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}-\frac {a^4\,40{}\mathrm {i}}{3}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(c + d*x)*1i)^4/cos(c + d*x),x)

[Out]

(35*a^4*atanh(tan(c/2 + (d*x)/2)))/(4*d) - ((a^4*tan(c/2 + (d*x)/2)^2*136i)/3 - (35*a^4*tan(c/2 + (d*x)/2)^3)/
4 - a^4*tan(c/2 + (d*x)/2)^4*40i - (35*a^4*tan(c/2 + (d*x)/2)^5)/4 + a^4*tan(c/2 + (d*x)/2)^6*8i + (27*a^4*tan
(c/2 + (d*x)/2)^7)/4 - (a^4*40i)/3 + (27*a^4*tan(c/2 + (d*x)/2))/4)/(d*(6*tan(c/2 + (d*x)/2)^4 - 4*tan(c/2 + (
d*x)/2)^2 - 4*tan(c/2 + (d*x)/2)^6 + tan(c/2 + (d*x)/2)^8 + 1))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ a^{4} \left (\int \left (- 6 \tan ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\right )\, dx + \int \tan ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 4 i \tan {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int \left (- 4 i \tan ^{3}{\left (c + d x \right )} \sec {\left (c + d x \right )}\right )\, dx + \int \sec {\left (c + d x \right )}\, dx\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+I*a*tan(d*x+c))**4,x)

[Out]

a**4*(Integral(-6*tan(c + d*x)**2*sec(c + d*x), x) + Integral(tan(c + d*x)**4*sec(c + d*x), x) + Integral(4*I*
tan(c + d*x)*sec(c + d*x), x) + Integral(-4*I*tan(c + d*x)**3*sec(c + d*x), x) + Integral(sec(c + d*x), x))

________________________________________________________________________________________